package com.tansun.easycare.rule.executionblock.entity;

import java.util.List;

import org.hibernate.validator.constraints.Length;

import com.tansun.easycare.rule.common.entity.RuleBaseEntity;
import com.tansun.easycare.rule.common.model.SelectModelVo;

/**
 * 执行块Entity
 *
 * @author zl
 * @version 2019-11-26
 */
public class RuleExcutionBlock extends RuleBaseEntity<RuleExcutionBlock> implements Comparable<RuleExcutionBlock>{

    private static final long serialVersionUID = 1L;
    private String execName;        // 规则模型名
    private String projectCode;        // 规则库编码
    private String manageId;        // 规则信息ID
    private String execCode;        // 规则模型编号
    private String modelType;        // 规则模型类型
    private String version;
    private String isValid;        // 是否生效
    private Integer seq;        // 序号
    private String blockVersion; //管理版本
    private String sortLevel;  //优先级
    private String conditions;  //条件
    private String conditionsJson;  //条件JSON
    
    private  boolean  checked;

    private List<SelectModelVo> exeCodes;

    private List<SelectModelVo> versions;

    public RuleExcutionBlock() {

    }

    public RuleExcutionBlock(String id) {
        super(id);
    }

    @Length(min = 0, max = 50, message = "规则模型名长度必须介于 0 和 50 之间")
    public String getExecName() {
        return execName;
    }

    public void setExecName(String execName) {
        this.execName = execName;
    }

    @Length(min = 0, max = 50, message = "规则库编码长度必须介于 0 和 50 之间")
    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    @Length(min = 0, max = 50, message = "规则信息ID长度必须介于 0 和 50 之间")
    public String getManageId() {
        return manageId;
    }

    public void setManageId(String manageId) {
        this.manageId = manageId;
    }

    @Length(min = 0, max = 20, message = "规则模型编号长度必须介于 0 和 20 之间")
    public String getExecCode() {
        return execCode;
    }

    public void setExecCode(String execCode) {
        this.execCode = execCode;
    }

    @Length(min = 0, max = 50, message = "规则模型类型长度必须介于 0 和 50 之间")
    public String getModelType() {
        return modelType;
    }

    public void setModelType(String modelType) {
        this.modelType = modelType;
    }

    @Length(min = 0, max = 10, message = "是否生效长度必须介于 0 和 10 之间")
    public String getIsValid() {
        return isValid;
    }

    public void setIsValid(String isValid) {
        this.isValid = isValid;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getBlockVersion() {
        return blockVersion;
    }

    public void setBlockVersion(String blockVersion) {
        this.blockVersion = blockVersion;
    }

    public List<SelectModelVo> getExeCodes() {
        return exeCodes;
    }

    public void setExeCodes(List<SelectModelVo> exeCodes) {
        this.exeCodes = exeCodes;
    }

    public List<SelectModelVo> getVersions() {
        return versions;
    }

    public void setVersions(List<SelectModelVo> versions) {
        this.versions = versions;
    }

	public String getSortLevel() {
		return sortLevel;
	}

	public void setSortLevel(String sortLevel) {
		this.sortLevel = sortLevel;
	}

	public String getConditions() {
		return conditions;
	}

	public void setConditions(String conditions) {
		this.conditions = conditions;
	}

	public String getConditionsJson() {
		return conditionsJson;
	}

	public void setConditionsJson(String conditionsJson) {
		this.conditionsJson = conditionsJson;
	}

	@Override
	public int compareTo(RuleExcutionBlock o) {
		return (this.getSortLevel()+this.getSeq()).compareTo(o.getSortLevel()+o.getSeq());
	}

	public boolean isChecked() {
		return  checked;
	}
	
}